//
//  AboutUsAppInfoTVC.swift
//  LeTu
//
//  Created by gy on 2023/11/28.
//

import UIKit

class AboutUsAppInfoTVC: BaseTableViewCell {

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        configUI()
    }
    
    // MARK: - configUI
    func configUI() {
        
        contentView.addSubview(backView)
        backView.addSubview(appIconImgView)
        backView.addSubview(versionLabel)
        backView.addSubview(companyLabel)

        backView.snp.makeConstraints { make in
            make.left.equalTo(16)
            make.right.equalTo(-16)
            make.centerY.equalToSuperview()
        }
        appIconImgView.snp.makeConstraints { make in
            make.top.centerX.equalToSuperview()
            make.width.height.equalTo(42)
        }
        versionLabel.snp.makeConstraints { make in
            make.left.right.centerX.equalToSuperview()
            make.top.equalTo(appIconImgView.snp.bottom).offset(10)
        }
        companyLabel.snp.makeConstraints { make in
            make.left.right.bottom.centerX.equalToSuperview()
            make.top.equalTo(versionLabel.snp.bottom).offset(12)
        }
    }
    private lazy var backView: UIView = {
        let backView = UIView()
        return backView
    }()
    private lazy var appIconImgView: UIImageView = {
        let appIconImgView = UIImageView()
        appIconImgView.image = UIImage(named: "logo_icon")
        return appIconImgView
    }()
    private var versionLabel: UILabel = {
        let versionLabel = UILabel()
        versionLabel.font = kSetPingFangMedium(14)
        versionLabel.textAlignment = .center
        versionLabel.text = "v \(Device.getAppVersion())"
        return versionLabel
    }()
    private var companyLabel: UILabel = {
        let companyLabel = UILabel()
        companyLabel.textAlignment = .center
        companyLabel.textColor = UIColor(red: 0.145, green: 0.165, blue: 0.208, alpha: 1)
        companyLabel.text = "北京家城科技有限公司".localized
        companyLabel.font = kSetPingFangRegular(14)
        return companyLabel
    }()
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
